package com.jeff.tianti.cms.service;

import com.jeff.tianti.cms.entity.ConsultCompliance;
import com.jeff.tianti.cms.entity.Media;
import com.jeff.tianti.cms.dao.MediaDao;
import com.jeff.tianti.cms.dto.MediaQueryDTO;
import com.jeff.tianti.common.service.CommonService;
import com.jeff.tianti.common.entity.PageModel;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * @author xujianfang
 * @desc MediaService�� 
 * @date 2019-07-08
 */
@Service
public class MediaService extends CommonService< Media,String >  {

    @Autowired
    private MediaDao mediaDao;

    @Autowired
    public void setMediaDao(MediaDao mediaDao){
      super.setCommonDao(mediaDao);
    }

    public PageModel<Media> queryMediaPage(MediaQueryDTO mediaQueryDTO){
           return this.mediaDao.queryMediaPage(mediaQueryDTO);
    }

    public List<Media> queryMediaList(MediaQueryDTO mediaQueryDTO){
           return this.mediaDao.queryMediaList(mediaQueryDTO);
    }


    public List<Media> findAllNoDel(  Pageable pageable ) {
        Page<Media> page = this.mediaDao.findAllNoDel(pageable);
        return page.getContent();
    }


    public Page<Media> findByUid(String uid, Pageable pageable) {
        return mediaDao.findByUid(uid,pageable);
    }
}